<?php

namespace app\admin\controller;

use DateTime;
use think\facade\Db;
use think\facade\View;
use utils\JsonHandle;

class Player extends BaseController
{
    //页面跳转
    public function index()
    {
        return View::fetch("index",
            ['url' => "https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8"]);
    }

    /*
     * json数据获取
     *
     */
    public function api()
    {
        //data.php
        $yzm = array(
            'danmuon' => 'on', //
            'color' => '#00a1d6',  //主题颜色
            'logo' => '',
            'trytime' => '1',  //试看
            'waittime' => '3', //跳转等待播放时间
            'sendtime' => '1', //间隔弹屏
            'dmrule' => '../dmku/dm_rule.html', //弹幕礼仪
            'pbgjz' => '网址,网站,支付宝,企,关注,wx,微信,qq,QQ',
            //广告部分
            'ads' =>
                array(
                    'state' => 'on',   //开关
                    'set' =>
                        array(
                            'state' => '2',  //1 视频 2 图片
                            'group' => '0',  // <0的用户提供广告
                            'pic' => //
                                array(
                                    'time' => '2',
                                    'img' => '/static/player/img/yntv.png',
                                    'link' => '',
                                ),
                            'vod' => //
                                array(
                                    'url' => '/static/player/mp4/ad.mp4',
                                    'link' => '',
                                ),
                        ),
                    'pause' => //
                        array(
                            'pic' => '/static/player/img/yntv.png',
                            'link' => '',
                            "state" => "on",
                        ),
                ),
        );
        $json = [
            'code' => 1,
            'data' => $yzm
        ];
        die(json_encode($json));
    }

}
